x11: Stop using gdk_surface_new_temp
authorMatthias Clasen <mclasen@redhat.com>
Thu, 8 Oct 2020 01:01:31 +0000 (21:01 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 8 Oct 2020 01:02:22 +0000 (21:02 -0400)
No need to roundtrip through the frontend to create
one of our own surfaces.

gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkdrag-x11.c
gdk/x11/gdksurface-x11.c

index 99d21f6b2a2d2aa8a196471082aaff0652740afe..b6a223d914f0ecb5316f7095dd9b981b36598b60 100644 (file)
@@ -1441,10 +1441,11 @@ gdk_x11_display_open (const char *display_name)
 
   gdk_event_init (display);
 
-  {
-    GdkRectangle rect = { -100, -100, 1, 1 };
-    display_x11->leader_gdk_surface = gdk_surface_new_temp (display, &rect);
-  }
+  display_x11->leader_gdk_surface =
+      _gdk_x11_display_create_surface (display,
+                                       GDK_SURFACE_TEMP,
+                                       NULL,
+                                       -100, -100, 1, 1);
 
   (_gdk_x11_surface_get_toplevel (display_x11->leader_gdk_surface))->is_leader = TRUE;
 
index 80f40f17d1e7050e4b63999934e79b5e231726aa..8e40cab4471b590163e798cd65ca3b620f02f22b 100644 (file)
@@ -1269,7 +1269,10 @@ create_drag_surface (GdkDisplay *display)
 {
   GdkSurface *surface;
 
-  surface = gdk_surface_new_temp (display, &(GdkRectangle) { 0, 0, 100, 100 });
+  surface = _gdk_x11_display_create_surface (display,
+                                             GDK_SURFACE_TEMP,
+                                             NULL,
+                                             0, 0, 100, 100);
 
   return surface;
 }
@@ -1999,7 +2002,10 @@ _gdk_x11_surface_drag_begin (GdkSurface         *surface,
 
   display = gdk_surface_get_display (surface);
 
-  ipc_surface = gdk_surface_new_temp (display, &(GdkRectangle) { -99, -99, 1, 1 });
+  ipc_surface = _gdk_x11_display_create_surface (display,
+                                                 GDK_SURFACE_TEMP,
+                                                 NULL,
+                                                 -99, -99, 1, 1);
 
   drag = (GdkDrag *) g_object_new (GDK_TYPE_X11_DRAG,
                                    "surface", ipc_surface,
index eabb2980716baf4bf0199df0544a994c2c1be541..24b536cb969e3396c16e0560784d3a2e2c0a0c80 100644 (file)
@@ -4114,11 +4114,15 @@ create_moveresize_surface (MoveResizeData *mv_resize,
                           guint32         timestamp)
 {
   GdkGrabStatus status;
-  GdkRectangle rect = { -100, -100, 1, 1 };
 
   g_assert (mv_resize->moveresize_emulation_surface == NULL);
 
-  mv_resize->moveresize_emulation_surface = gdk_surface_new_temp (mv_resize->display, &rect);
+  mv_resize->moveresize_emulation_surface =
+      _gdk_x11_display_create_surface (mv_resize->display,
+                                       GDK_SURFACE_TEMP,
+                                       NULL,
+                                       -100, -100, 1, 1);
+
   gdk_x11_surface_show (mv_resize->moveresize_emulation_surface, FALSE);
 
   status = gdk_seat_grab (gdk_device_get_seat (mv_resize->device),